<?php

namespace Business;

class Message extends Base {

    public function addMessage($name, $phoneNum, $content) {

        if(!$name) {
            $this->throwException('请填写姓名');
        }
        if(!$phoneNum) {
            $this->throwException('请填写手机号');
        }
        if(!$content) {
            $this->throwException('请填写内容');
        }
        \Data\Message::instance()->addMessage($name, $phoneNum, $content);
    }

    public function getMessage($pager) {
        $info = \Data\Message::instance()->getMessage($pager);
        return $info;
    }

    public function getMessageById($id) {

        $info = \Data\Message::instance()->getMessageById($id);
        return $info;
    }

    public function delMessageById($id) {
       \Data\Message::instance()->delMessageById($id);
    }
}